Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating an account with MAS, change the prompt parameter to create #3635

Closed
wants to merge 1 commit into from

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Oct 9, 2024

Content

When user is creating account, load the url page directly in the account creation mode by changing (or adding) the prompt url parameter to create.

@sandhose does it make sense to you?

Motivation and context

Improve user experience with MAS and closes #3627

Screenshots / GIFs

Before After
MAS-account_creation_before.mp4
MAS-account_creation_after.mp4

Tests

  • Try creating an account on a server with MAS support, such as beta.matrix.org and observe that you're having a wonderful navigation experience.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner October 9, 2024 13:40
@bmarty bmarty requested review from ganfra and sandhose and removed request for a team October 9, 2024 13:40
}
appendQueryParameter(key, value)
}.build()
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only appendQueryParameter exists in Uri.Builder, so sadly, I had to create this extension.

// In this case, add or replace the "prompt" parameter to "create"
val newUrl = oidcDetails.url.toUri()
.setQueryParameter("prompt", "create")
.toString()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the provided value for the "prompt" parameter on beta.matrix.org is "consent".

@bmarty bmarty changed the title When creating an account, change the prompt parameter to create When creating an account with MAS, change the prompt parameter to create Oct 9, 2024
Copy link
Contributor

github-actions bot commented Oct 9, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/V8Ep1n

Copy link

sonarqubecloud bot commented Oct 9, 2024

Copy link
Member

@sandhose sandhose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmarty
Copy link
Member Author

bmarty commented Oct 15, 2024

OK so maybe we could improve the existing Rust API, to replace urlForOidcLogin() by urlForOidc(prompt: String), or simply add an API urlForOidcRegister()

@jmartinesp do you think this would be possible?

@jmartinesp
Copy link
Member

jmartinesp commented Oct 15, 2024

From a very quick look at the code, it seems feasible, although I'd rather make the Prompt an enum in the FFI layer so the client can't just pass any value. What do you think?

@bmarty
Copy link
Member Author

bmarty commented Oct 15, 2024

Yes, an enum would be better than a String. Thanks!

@bmarty
Copy link
Member Author

bmarty commented Oct 16, 2024

Closing this we will get a better way to handle this thanks to Jorge's work in matrix-org/matrix-rust-sdk#4131.

@bmarty bmarty closed this Oct 16, 2024
@bmarty bmarty deleted the feature/bma/oidcCreate branch October 16, 2024 09:32
@bmarty bmarty mentioned this pull request Oct 16, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send the user to oidc register page when creating account
3 participants